package com.wt.dao;

import com.wt.pojo.ShopGoods;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ShopGoodsMapper {
    @Delete({
        "delete from brand_admin_shop_goods",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into brand_admin_shop_goods (id, note, ",
        "title, thumb_img, ",
        "price, creation_time, ",
        "update_time, sold_out, ",
        "repertory, view, ",
        "categorie, goods_attr_id, ",
        "vendor_id, is_delete, ",
        "user_categories, age, ",
        "presell, productnum, ",
        "brand_id, categorie_erji, ",
        "categorie_sanji, waresid, ",
        "weight)",
        "values (#{id,jdbcType=INTEGER}, #{note,jdbcType=VARCHAR}, ",
        "#{title,jdbcType=VARCHAR}, #{thumbImg,jdbcType=VARCHAR}, ",
        "#{price,jdbcType=DECIMAL}, #{creationTime,jdbcType=VARCHAR}, ",
        "#{updateTime,jdbcType=VARCHAR}, #{soldOut,jdbcType=VARCHAR}, ",
        "#{repertory,jdbcType=INTEGER}, #{view,jdbcType=VARCHAR}, ",
        "#{categorie,jdbcType=INTEGER}, #{goodsAttrId,jdbcType=INTEGER}, ",
        "#{vendorId,jdbcType=INTEGER}, #{isDelete,jdbcType=VARCHAR}, ",
        "#{userCategories,jdbcType=INTEGER}, #{age,jdbcType=VARCHAR}, ",
        "#{presell,jdbcType=INTEGER}, #{productnum,jdbcType=VARCHAR}, ",
        "#{brandId,jdbcType=INTEGER}, #{categorieErji,jdbcType=INTEGER}, ",
        "#{categorieSanji,jdbcType=INTEGER}, #{waresid,jdbcType=INTEGER}, ",
        "#{weight,jdbcType=SMALLINT})"
    })
    int insert(ShopGoods record);

    int insertSelective(ShopGoods record);

    @Select({
        "select",
        "id, note, title, thumb_img, price, creation_time, update_time, sold_out, repertory, ",
        "view, categorie, goods_attr_id, vendor_id, is_delete, user_categories, age, ",
        "presell, productnum, brand_id, categorie_erji, categorie_sanji, waresid, weight",
        "from brand_admin_shop_goods",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    ShopGoods selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ShopGoods record);

    @Update({
        "update brand_admin_shop_goods",
        "set note = #{note,jdbcType=VARCHAR},",
          "title = #{title,jdbcType=VARCHAR},",
          "thumb_img = #{thumbImg,jdbcType=VARCHAR},",
          "price = #{price,jdbcType=DECIMAL},",
          "creation_time = #{creationTime,jdbcType=VARCHAR},",
          "update_time = #{updateTime,jdbcType=VARCHAR},",
          "sold_out = #{soldOut,jdbcType=VARCHAR},",
          "repertory = #{repertory,jdbcType=INTEGER},",
          "view = #{view,jdbcType=VARCHAR},",
          "categorie = #{categorie,jdbcType=INTEGER},",
          "goods_attr_id = #{goodsAttrId,jdbcType=INTEGER},",
          "vendor_id = #{vendorId,jdbcType=INTEGER},",
          "is_delete = #{isDelete,jdbcType=VARCHAR},",
          "user_categories = #{userCategories,jdbcType=INTEGER},",
          "age = #{age,jdbcType=VARCHAR},",
          "presell = #{presell,jdbcType=INTEGER},",
          "productnum = #{productnum,jdbcType=VARCHAR},",
          "brand_id = #{brandId,jdbcType=INTEGER},",
          "categorie_erji = #{categorieErji,jdbcType=INTEGER},",
          "categorie_sanji = #{categorieSanji,jdbcType=INTEGER},",
          "waresid = #{waresid,jdbcType=INTEGER},",
          "weight = #{weight,jdbcType=SMALLINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ShopGoods record);
}